package com.jy.appmarket.network.engine;

import java.util.Map;

import android.content.Context;

import com.jy.appmarket.network.resultdata.PageResult;

/**
/** 
 * 类说明：   
 * @author thinker.fan
 * @date    2014-5-6
 * @version 1.0
 */
public class SearchNetEngine extends BaseNetEngine {

	private static final String COMMAND = "search";
	private int mPage;
	private String mKey;
	private long mDataVersion;

	public SearchNetEngine(long dataVersion, int pageIndex, String key) {
		mHttpMethod = HTTP_GET;
		mPage = pageIndex;
		mKey = key;
		mResultData = new PageResult();
	}

	@Override
	protected String getCommand() {
		return COMMAND;
	}

	@Override
	protected void getParams(Context context, Map<String, String> custParams) {
		custParams.put("pageNo", String.valueOf(mPage));
		custParams.put("q", mKey);
		if (mDataVersion != 0) {
			custParams.put("dataVersion", String.valueOf(mDataVersion));
		}
	}

}
